let express  = require('express')
let cors = require('cors')
let bodyParser = require('body-parser')
let router = require('./router')
let app = express()
const path = require('path');



app.use(bodyParser.json())
app.use(bodyParser.urlencoded({extended:false}))
app.use(cors())
app.use(router)
// 配置静态文件服务，允许访问上传的文件
app.use('/uploads', express.static(path.join(__dirname, 'uploads')));



app.listen(80,()=>{
    console.log('服务器启动成功');
})